package AnonymousInnerClasses;

public class Text {
    public static void main(String[] args) {
        Animal animal1 = new Animal() {
            @Override
            public void run() {
                System.out.println("狂狂地乱跑");
            }
        };
        Animal animal2 = new Animal() {
            @Override
            public void run() {
                System.out.println("优雅地走");
            }
        };
        go(animal1);
        go(animal2);
    }
    public static void go(Animal animal){
        animal.run();
    }
}
